<template>
         <Demo v-slot="info">
            <a href="#" @click="DeleteData(Number(info.id))">删除</a>&nbsp;
          
         </Demo>
</template>

<script setup lang="ts">
  import Demo from './Demo.vue'
  import axios from 'axios'

  //完成删除功能
  const DeleteData =(Iid:number) =>{
         if(confirm('你确定要删除吗?'))
         {
              axios({
                  url:"https://localhost:44337/api/Invests/DeleteInvestInfo",
                  method:"delete",
                  params:{
                      Iid:Iid
                  }
              }).then(res=>{
                 if(res.data>0)
                 {
                     alert('删除成功');
                     //LoadData();
                 } else if(res.data==-1)
                 {
                     alert('无法删除,项目已经有人投资!')
                 }
                 else
                 {
                     alert('删除失败');
                 }
              })
         }
  }

</script>